package team.gs.control;

import huytq.gs.view.LoadScene;
import huytq.gs.view.LoginScene;

import org.andengine.engine.Engine;
import org.andengine.ui.IGameInterface.OnCreateSceneCallback;

import team.gs.model.BaseScene;

public class SceneManager {
	private static final SceneManager INSTANCE = new SceneManager();
	private BaseScene loadscene, loginscene;
	private BaseScene currentScene;
	private Engine engine = ResourcesManager.getInstance().engine;

	private void setScene(BaseScene scene) {
		engine.setScene(scene);
		currentScene = scene;

	}

	public static SceneManager getInstance() {
		return INSTANCE;
	}

	public BaseScene getCurrentScene() {
		return currentScene;
	}

	public void createCompany(OnCreateSceneCallback pOnCreateSceneCallback) {
		ResourcesManager.getInstance().loadCompany();
		loadscene = new LoadScene();
		SceneManager.getInstance().setScene(loadscene);
		pOnCreateSceneCallback.onCreateSceneFinished(loadscene);
	}

	public void createLogin() {
		loginscene = new LoginScene();
		SceneManager.getInstance().setScene(loginscene);
	}
}
